package com.kayt.cyberBar.cuser.business.entity.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonBackReference;

/**
 * BWorkRequest entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "b_work_request")
public class BWorkRequest implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1591080945614067223L;
	private Long id;
	private String requestCode;
	private String reqTypeCode;
	private String requestDescription;
	private String reqTime;
	private String createTime;
	private String updateTime;
	private String statusCode;
	private String userCode;
	private BWorkExam workExam;
	private BUser bUser;
	private BWorkRequestRes workRequestRes;
	// Constructors

	/** default constructor */
	public BWorkRequest() {
	}

	/** full constructor */
	public BWorkRequest(String requestCode,
			String reqTypeCode, String reqTime, String createTime,
			String updateTime, String statusCode) {
		this.requestCode = requestCode;
		this.reqTypeCode = reqTypeCode;
		this.reqTime = reqTime;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.statusCode = statusCode;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "REQUEST_CODE", length = 64)
	public String getRequestCode() {
		return this.requestCode;
	}

	public void setRequestCode(String requestCode) {
		this.requestCode = requestCode;
	}

	@Column(name = "REQ_TYPE_CODE", length = 64)
	public String getReqTypeCode() {
		return this.reqTypeCode;
	}

	public void setReqTypeCode(String reqTypeCode) {
		this.reqTypeCode = reqTypeCode;
	}

	@Column(name = "REQ_TIME", length = 64)
	public String getReqTime() {
		return this.reqTime;
	}

	public void setReqTime(String reqTime) {
		this.reqTime = reqTime;
	}

	@Column(name = "CREATE_TIME", length = 64)
	public String getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	@Column(name = "UPDATE_TIME", length = 64)
	public String getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "STATUS_CODE", length = 64)
	public String getStatusCode() {
		return this.statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}
	@Column(name = "REQUEST_DESCRIPTION", length = 1024)
	public String getRequestDescription() {
		return requestDescription;
	}

	public void setRequestDescription(String requestDescription) {
		this.requestDescription = requestDescription;
	}

	@ManyToOne(targetEntity = BUser.class, fetch = FetchType.LAZY)
	@JoinColumn(name="USER_CODE", referencedColumnName="USER_CODE", nullable = false,insertable=false,updatable=false)
	@JsonBackReference
	public BUser getbUser() {
		return bUser;
	}

	public void setbUser(BUser bUser) {
		this.bUser = bUser;
	}

	@OneToOne(targetEntity = BWorkExam.class, fetch = FetchType.LAZY)
	@JoinColumn(name="EXAM_CODE", referencedColumnName="EXAM_CODE", nullable = false)
	@JsonBackReference
	public BWorkExam getWorkExam() {
		return workExam;
	}

	public void setWorkExam(BWorkExam workExam) {
		this.workExam = workExam;
	}
	
	@OneToOne(targetEntity = BWorkRequestRes.class, fetch = FetchType.LAZY)
	@JoinColumn(name="REQUEST_CODE", referencedColumnName="REQUEST_CODE", nullable = false,insertable=false,updatable=false)
	@JsonBackReference
	public BWorkRequestRes getWorkRequestRes() {
		return workRequestRes;
	}

	public void setWorkRequestRes(BWorkRequestRes workRequestRes) {
		this.workRequestRes = workRequestRes;
	}

	@Column(name = "USER_CODE", length = 64)
	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	
	
}